<?php /* @var $this Controller */ ?>
<?php $this->beginContent('//layouts/main'); ?>
<div class="span-6 last">
	
	<div class="userlayer">
	<?php if(Yii::app() -> session['polo_id']) { ?>
		<div id="user">
			<?php echo '<p style="padding:5px; border: 1px solid #ededed;"> PÓLO:  <b>'. Polo::model()->findByPk(Yii::app() -> session['polo_id'])->nome.'</b> </p>'?>
			<?php 
			$myvalue1 = Yii::app()->session['nome'];
			$arr = explode(' ',trim($myvalue1));
			
			echo '<p style="padding:5px; border: 1px solid #ededed;"> USUÁRIO:  <b>'. $arr[0] ."</b></p>";?>
			<?php echo '<p style="padding:5px; border: 1px solid #ededed;"> Tipo:  <b>'. Yii::app() -> session['user_type'].'</b> </p>'?>
		</div>

		<?php $this->widget('zii.widgets.CMenu',array(
				'items'=>array(
						array('label'=>'Início', 'url'=>array('/site/index'),'visible'=>!Yii::app()->user->isGuest),
						array('label'=>Aluno::getModuleName().'s', 'url'=>array('/aluno/index'),'visible'=>!Yii::app()->user->isGuest),
						array('label'=>'Turmas', 'url'=>array('/turma/index'),'visible'=>!Yii::app()->user->isGuest),
						array('label'=>'Colaboradores', 'url'=>array('/funcionario/index'),'visible'=>!Yii::app()->user->isGuest && Yii::app() -> session['user_type']  != 'Voluntario'),
						array('label'=>'Periodo de Inscrição', 'url'=>array('/periodo/index'),'visible'=>false),
						array('label'=>'Sair', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),
				),
				'htmlOptions'=>array('id'=>'mainmenu'),
			)); ?>
		<?php			
		$this->beginWidget('zii.widgets.CPortlet', array(
				'title'=>'Operações:',
		));
		$this->widget('bootstrap.widgets.TbMenu', array(
				'items'=>$this->menu,
				'htmlOptions'=>array('class'=>'operations'),
		));
		$this->endWidget();
		?>
	</div>

	<!-- sidebar -->
	<?php $this->widget('bootstrap.widgets.TbAlert', array(
			'block'=>true, // display a larger alert block?
			'fade'=>true, // use transitions?
			'closeText'=>'&times;', // close link text - if set to false, no close link is displayed
			'alerts'=>array( // configurations per alert type
					'success'=>array('block'=>true, 'fade'=>true, 'closeText'=>'&times;'), // success, info, warning, error or danger
			),
                )); ?>


</div>
<div class="span-19">

	<?php if(isset($this->breadcrumbs)):?>
	<?php $this->widget('bootstrap.widgets.TbBreadcrumbs', array(
			'links'=>$this->breadcrumbs,
	)); ?>
	<!-- breadcrumbs -->
	<?php endif?>
	<div id="content">
		<?php echo $content; ?>
	</div>
	<!-- content -->
</div>
<?php } else { ?>
<div id="content">
	<?php echo $content; ?>
</div>
<!-- content -->
</div>
</div>
<?php }?>
<?php $this->endContent(); ?>